﻿CREATE PROCEDURE [dbo].[proc_OpcoesRefeicoesLoadAll]
AS
BEGIN

	SET NOCOUNT ON
	DECLARE @Err int

	SELECT
		o.[IdRefeicaoContratada],
		o.[DataRefeicao],
		o.[CodOpcao],
		o.[Descricao],
		o.[DataCriacao],
		o.[DataAlteracao],
		t.Descricao as DescricaoOpcao,
		t.DescricaoCurta as DescricaoCurtaOpcao,
		t.Simbolo as SimboloOpcao,
		t.Tipo as TipoOpcao
	FROM [OpcoesRefeicoes] o
			inner join Tipologias t on o.CodOpcao = t.Codigo and t.Tipo = 'TipoOpcao' 

	SET @Err = @@Error

	RETURN @Err
END
